package model.datastructure;

/**
 * An <code>AbstractBlock</code> represents a block witch can be placed within a
 * field. An Abstract block has a dimension and a position. These can differ in
 * each implementation of a AbstractBlock.
 * 
 * @version 0.1 11/24/10
 * @author Ingmar te Raa
 * 
 * @see IDimension
 * @see IPosition
 */
public abstract class AbstractBlock {

	/**
	 * The position of a block
	 * 
	 * @see IPosition
	 */
	protected IPosition mPosition;
	
	protected int rotation;

	/**
	 * The <code>AbstractBlockType</code> of a block.
	 * 
	 * @see AbstractBlock
	 */
	protected AbstractBlockType mBlockType;

	/**
	 * Create a new <code>AbstractBlock</code>. A dimension and position must be
	 * provided.
	 * 
	 * @param dimention
	 *            - the dimension of the block. Use an instance of IDimension.
	 * @param position
	 *            - the position of the block. Use an instance of IPosition.
	 * @param blockType
	 *            - the block type of a block
	 * @see IDimension
	 * @see IPosition
	 * @see AbstractBlockType
	 */
	public AbstractBlock(IPosition position, AbstractBlockType blockType) {
		mPosition = position;
		mBlockType = blockType;
	}

	/**
	 * Get the position of the <code>AbstractBlock</code>.
	 * 
	 * @return Returns the position of the <code>AbstractBlock</code>.
	 */
	public IPosition getPosition() {
		return mPosition;
	}
	
	/**
	 * @param mPosition the mPosition to set
	 */
	public void setPosition(IPosition mPosition) {
		this.mPosition = mPosition;
	}
	
	/**
	 * @return the rotation
	 */
	public int getRotation() {
		return rotation;
	}

	/**
	 * @param rotation the rotation to set
	 */
	public void setRotation(int rotation) {
		this.rotation = rotation;
	}	

	/**
	 * Get the blocktype of a block.
	 * 
	 * @return Returns the blocktype of the <code>AbstractBlock</code>
	 */
	public abstract AbstractBlockType getBlockType();

}